<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddLiveMeetingRoomUser extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('live_meeting_room_user', function (Blueprint $table) {
            $table ->increments('id') ->comment('直播间用户表');
            $table ->string('meeting_id')->nullable() ->comment('会议id');
            $table ->integer('user_id')->default('0') ->comment('用户id');
            $table ->string('room_user_no') ->nullable() ->comment('用户编号');
            $table ->string('room_no') ->nullable() ->comment('房间号');
            $table ->integer('time_long')->default('0') ->comment('参与会议时长（秒）');
            $table ->tinyInteger('status')->default('0') ->comment('下线0，上线1，踢出2');
            $table ->tinyInteger('mike_status')->default('0') ->comment('当前连麦状态,连上1，断连0');
            $table ->timestamp('last_login_time') ->nullable()->comment('最近登陆时间');
            $table->text('token')->nullable()->comment('token');
            $table ->timestamp('token_expiration_time') ->nullable()->comment('token过期时间');
            $table ->string('audio_publish_stream_id') ->nullable() ->comment('音频流');
            $table ->timestamps();
            $table ->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('live_meeting_room_user', function (Blueprint $table) {
            //
        });
    }
}
